#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstring>
#include <stdio.h>
using namespace std;
const int N=200003,null2=0x3f3f3f3f;
int h[N];
int find(int x)
{
    int k=(x%N+N)%N;
    while(h[k]!=null2&&h[k]!=x)
    {
        k++;
        if(k==N)k=0;
    }
    return k;
}
int insert(int x);
int main()
{
    int n;
    cin>>n;
    memset(h,0x3f,sizeof(h));
    while(n--)
    {
        char op[2];
        int x;
        scanf("%s%d",op,&x);
        if(*op=='I')
        {
            int k=find(x);
            h[k]=x;
        }
        else 
        {
            if(h[find(x)]!=null2)cout<<"Yes"<<endl;
            else cout<<"No"<<endl;
        }
    }
}